package com.cskaoyan.controller;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wxcatalog.CatalogData;
import com.cskaoyan.bean.wxcatalog.CurrentCatalogData;
import com.cskaoyan.service.WxCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: yudefu
 * @date 2021年06月07日  21:52
 * @description: 类目模块
 */

@RestController
@RequestMapping("wx/catalog")
public class WxCatalogController {

    @Autowired
    WxCatalogService catalogService;

    @RequestMapping("current")
    public BaseRespVo getCurrentCatalog(Integer id) {

        CurrentCatalogData currentCatalogData = catalogService.getCurrentCatalog(id);

        return BaseRespVo.ok(currentCatalogData);
    }

    @RequestMapping("index")
    public BaseRespVo getCatalogIndex() {

        CatalogData catalogData = catalogService.getCatalogIndex();

        return BaseRespVo.ok(catalogData);
    }
}
